﻿namespace MicroCloud.Message.Dtos
{
    /// <summary>
    /// 消息简单DTO
    /// </summary>
    [MapFrom(typeof(MessageEntity))]
    public class MessageDtoSimple : IOutputDto
    {
        #region "属性"
        #region "获取或设置 编号"
        /// <summary>
        /// 获取或设置 编号
        /// </summary>
        [DisplayName("编号")]
        public long Id { get; set; }
        #endregion

        #region "获取或设置 方法名"
        /// <summary>
        /// 获取或设置 方法名
        /// </summary>
        [DisplayName("方法名")]
        public string Method { get; set; }
        #endregion

        #region "获取或设置 消息图标"
        /// <summary>
        /// 获取或设置 消息图标
        /// </summary>
        [DisplayName("消息图标")]
        public string Icon { get; set; }
        #endregion
        #region "获取或设置 消息类型"
        /// <summary>
        /// 获取或设置 消息类型
        /// </summary>
        [DisplayName("消息类型")]
        public MessageType MessageType { get; set; }
        #endregion
        #region "获取或设置 消息级别"
        /// <summary>
        /// 获取或设置 消息级别
        /// </summary>
        [DisplayName("消息级别")]
        public MessageLevel MessageLevel { get; set; }
        #endregion
        #region "获取或设置 标题"
        /// <summary>
        /// 获取或设置 标题
        /// </summary>
        [DisplayName("标题")]
        public string Title { get; set; }
        #endregion
        #region "获取或设置 内容"
        /// <summary>
        /// 获取或设置 内容
        /// </summary>
        [DisplayName("内容")]
        public string Content { get; set; }
        #endregion

        #region "获取或设置 发送时间"
        /// <summary>
        /// 获取或设置 发送时间
        /// </summary>
        [DisplayName("发送时间")]
        public DateTime SendTime { get; set; }
        #endregion

        #region "获取或设置 系统消息"
        /// <summary>
        /// 获取或设置 系统消息
        /// </summary>
        [DisplayName("系统消息")]
        public bool IsSystem { get; set; }
        #endregion
        #region "获取或设置 发送者编号"
        /// <summary>
        /// 获取或设置 发送者编号
        /// </summary>
        [DisplayName("发送者编号")]
        public long? SenderId { get; set; }
        #endregion
        #region "获取或设置 发送者名称"
        /// <summary>
        /// 获取或设置 发送者名称
        /// </summary>
        [DisplayName("发送者名称")]
        public string SenderName { get; set; }
        #endregion
        #region "获取或设置 发送者昵称"
        /// <summary>
        /// 获取或设置 发送者昵称
        /// </summary>
        [DisplayName("发送者昵称")]
        public string SenderNickname { get; set; }
        #endregion

        #region "获取或设置 阅读时间"
        /// <summary>
        /// 获取或设置 阅读时间
        /// </summary>
        [DisplayName("阅读时间")]
        public DateTime? LastReadTime { get; set; }
        #endregion
        #region "获取或设置 阅读方式"
        /// <summary>
        /// 获取或设置 阅读方式
        /// </summary>
        [DisplayName("阅读方式")]
        public MessageSendWay? LastReadWay { get; set; }
        #endregion

        #region "获取 是否已读"
        /// <summary>
        /// 获取 是否已读
        /// </summary>
        [DisplayName("是否已读")]
        public bool IsRead => LastReadTime.HasValue;
        #endregion

        #endregion

    }

}                                         